<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no, viewport-fit=cover" />
        <link rel="icon" type="image/png" href="/favicon.png" />
        <meta name="renderer" content="webkit" />
        <meta name="force-rendering" content="webkit" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>登出</title>
        <style>
            ::-webkit-scrollbar {
                width: 10px;
                height: 10px;
            }
            ::-webkit-scrollbar-thumb {
                width: 6px;
                height: 6px;
                border-radius: 6px;
                background: rgba(187, 187, 187, 0.8);
                background-clip: padding-box;
                border: 2px solid transparent;
            }
            ::-webkit-scrollbar-thumb:active,
            ::-webkit-scrollbar-thumb:hover {
                background: rgba(125, 125, 125, 0.8);
                background-clip: padding-box;
            }
        </style>
        <link rel="stylesheet" href="/src/common/mdcss/freestyle.css" />
        <script src="/src/common/mdjs/freestyle.js"></script>
    </head>
    <body>
        <script>
            var __api_server__ = <%- apiServer %>;
            if (/\/portal\//.test(location.pathname)) {
                window.subPath = '/portal';
            }
            var request = new XMLHttpRequest();
            request.open('POST', __api_server__.main + 'Login/LoginOut');
            request.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');
            request.send();
            request.onload = function () {
                if (this.status >= 200 && this.status < 400) {
                    var resp = this.response;
                    try {
                        resp = JSON.parse(resp);
                        if (resp && resp.data) {
                            window.localStorage.removeItem('LoginCheckList');
                            if (resp.data.redirectUrl) {
                                location.href = resp.data.redirectUrl;
                            } else {
                                location.href =
                                    location.href.indexOf('?ReturnUrl') > -1
                                        ? (window.subPath || '') + '/network' + location.search
                                        : (window.subPath || '') + '/network';
                            }
                        }
                    } catch (err) {}
                }
            };
        </script>
    </body>
</html>
